package com.puman.watchtrade.util;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;

import com.puman.watchtrade.MainActivity;

public class NotiUtil {
	
	public static void setNotiType(String type,Context context,int iconId, String note,String content) {
	    NotificationManager mNotificationManager = 
	    		(NotificationManager) context.getSystemService(Service.NOTIFICATION_SERVICE);
		Intent intent = new Intent(context,MainActivity.class);
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP );
		intent.putExtra("fromNotify",2);
		//intent.putExtra("contentFromNotify",content);
//		MainActivity.setTuisongValue(content);//���͵�����
		
		PendingIntent appIntent = PendingIntent.getActivity(context, 0, intent, 0);
		Notification myNoti = new Notification();
		myNoti.icon = iconId;
		myNoti.tickerText = note;
		myNoti.defaults = Notification.DEFAULT_SOUND;
		//myNoti.defaults = Notification.DEFAULT_VIBRATE; 

		myNoti.setLatestEventInfo(context, type, note, appIntent);
		mNotificationManager.notify(0, myNoti);
	}
	
	
}
